﻿Public Class Lanfactory : Implements InterfaceTransfer

    Private LanEngine As Object
    Sub New(ByVal engine As Integer)
        If engine = 1 Then
            LanEngine = New Micro
        ElseIf engine = 2 Then
            LanEngine = New Youdao
        Else
            LanEngine = New Baidu
        End If
    End Sub

    Public Function trans(q As String, from_code As String, to_code As String) As String Implements InterfaceTransfer.trans
        Return LanEngine.trans(q, from_code, to_code)
    End Function
End Class
